# Rockchip sysutils Makefile

CFLAGS := -Wall -Werror -Wshadow -g -fpic -rdynamic -I./ -I./include
LD_FLAGS :=

SRCS := $(wildcard *.c)
OBJS  := $(SRCS:%.c=%.o)
target_lib_so := libdrivers.so
target_lib_static := libdrivers.a

all: $(OBJS) build-static

$(OBJS): $(SRCS)
	$(CC) -c $(filter $(basename $@)%, $^) $(LD_FLAGS) $(CFLAGS)

build-so:
	$(CC) $(CFLAGS) -shared $(OBJS) -o $(target_lib_so)

build-static:
	$(AR) -rcs $(target_lib_static) $(OBJS)

clean:
	@rm -f $(OBJS) $(target_lib_so) $(target_lib_static)
